//////////////////////////////////////////////////////////////////////////////////////////////
//	File			:	"InstructionsState.cpp"
//
//	Author			:	Mike Davis, Matt Stover, James Thornton, Keith Webster
//	
//	Project			:	TacWars
//
//	Last Modified	:	11/6/2013
//
//	Purpose			:	
//
//////////////////////////////////////////////////////////////////////////////////////////////
#include "InstructionsState.h"
#include "../../SGD Wrappers/CSGD_Direct3D.h"
#include "../../SGD Wrappers/CSGD_DirectInput.h"
#include "../../SGD Wrappers/CSGD_TextureManager.h"
#include "../../SGD Wrappers/CSGD_XAudio2.h"
#include "../../SGD Wrappers/CSGD_MessageSystem.h"
#include "../../SGD Wrappers/CSGD_EventSystem.h"
#include "../../SGD Wrappers/SGD_String.h"
#include "../../SGD Wrappers/SGD_Math.h"
#include "../Game.h"
#include <cassert>

InstructionsState* InstructionsState::GetInstance()
{
	static InstructionsState Instance;

	return &Instance;
}
InstructionsState::InstructionsState()
{
	cursor = 0;
}
InstructionsState::~InstructionsState()
{
}
/*virtual*/ void InstructionsState::Enter()
{
	titleImgID = CSGD_TextureManager::GetInstance()->LoadTexture(_T("resource/Images/MapStage3.png"));
}
/*virtual*/ void InstructionsState::Exit()
{

}
/*virtual*/ bool InstructionsState::Input()
{
	CSGD_DirectInput* DI = CSGD_DirectInput::GetInstance();

	if(DI->JoystickIsUnplugged())
	{
		if(DI->KeyPressed(DIK_ESCAPE) == true)
		{
			Game::GetInstance()->PopState();
		}
	}
	else
	{
		if(DI->JoystickButtonPressed(1) == true)
		{
			Game::GetInstance()->PopState();
		}
	}
	return true;
}
/*virtual*/ void InstructionsState::Update( float fElapsedTime )
{

}
/*virtual*/ void InstructionsState::Render()
{
	BitmapFont* Font = Game::GetInstance()->GetFont();
	CSGD_TextureManager::GetInstance()->Draw(titleImgID, 0, 0, 1.0f, 1.0f);

	Font->Draw( _T("INSTRUCTIONS"), 
		(int)((640 - (4*32*2.0f)) / 4), 
		50, 2.0f, D3DCOLOR_ARGB(255, 255, 255, 255) );


	//Font->Draw( _T("CREATED BY"), (600 - (4*32)) / 2, 200, 1.0f, D3DCOLOR_ARGB(255, 255, 255, 255) );
	//Font->Draw( _T("MIKE DAVIS\t\tMATTHEW STOVER\nJAMES THORNTON\tKEITH WEBSTER"), (200 - (4*32)) / 2, 250, 1.0f, D3DCOLOR_ARGB(255,255,255,255));
	//Font->Draw( _T("ASSOCIATE PRODUCER"), (800 - (4*32)) / 2, 400, 1.0f, D3DCOLOR_ARGB(255,255,255,255));
	//Font->Draw( _T("ROBERT MARTINEZ"), (800 - (4*32)) / 2, 450, 1.0f, D3DCOLOR_ARGB(255,255,255,255));
	//
	//Font->Draw(_T("OK"), (500-(4*32)) / 2, 700, 1.0f, D3DCOLOR_ARGB(255,255,255,255));
	Font->Draw( _T("(     )"), (500 - (7*32)) / 2, 700, 1.0f, D3DCOLOR_ARGB(255, 255, 255, 255) );

}
